

function adminAboutCtrl($scope, $route, $rootScope, $timeout, commonService , $location) {
    
    $rootScope.adminLoginPage = false;
    // Test Data
//    _pageData.user = {
//	    username : 'Kroekpong Sakulchai'
////	    username : 'Kroekpong Sakulchai',
//    } ;
    
    _log('Admin adminAboutCtrl ###');
    
    $scope.$watch('$viewContentLoaded', function() {
	
		var config = {
		    height: _COMMON.winHeight-189, // 189
//		    height: _COMMON.winHeight-280, // 189
		    startupOutlineBlocks:true,
//		    scayt_autoStartup:true,
//		    toolbarCanCollapse : true,
		    resize_enabled : false,
		    uiColor :'#2980b9'
		};
	
//	$('textarea#editorabout').ckeditor(config);
	CKEDITOR.plugins.registered['save'] = {
	    init : function(editor) {
		var command = editor.addCommand('save', {
		    modes : {
			wysiwyg : 1,
			source : 1
		    },
		    exec : function(editor) {
			// YOUR CODE
			// _log(_COMMON.dialog());
			// _log(editor.document.getBody().getHtml());
//			_msgbox.title = 'Confirm Save';
			var config = {
			    resizable : false,
			    title : 'ยืนยันการทำรายการ',
			    height : 200,
			    modal : true,
			    draggable: false,
			    open: function() {
				      var markup = '<br><b>บันทึก';
				      $(this).html(markup);
				    },
			    buttons : {
				"บันทึก" : function() {
				    $(this).dialog("close");
				    // confirm = true;
				    _log(editor.document.getBody().getHtml());
				    alert('Save Complete');
				},
				"ยกเลิก" : function() {
				    $(this).dialog("close");
				}
			    }
			};
			$("#confirm").dialog(config);
		    }
		});
		editor.ui.addButton('Save', {
		    label : 'บันทึก',
		    command : 'save'
		});
	    }
	};
	
	var url = 'content_ws.php';
    	var params = {
		wsname:'getcontentbycategoryid',
		catid:2,
		token:_pageData.tokenKey
	};
    	$.getJSON(
   		 _COMMON.context+url, 
		    params
	    , function(result) {
//   		  console.log( "1 success" );_log(result);
	    }).done(function(result) {
		    if(result['contents']){
			_pageData['content'] = result['contents'][0];
			$('textarea#editorabout').ckeditor(config);
			$('textarea#editorabout').val(_pageData['content'].fulltext);
		    }
	    });
	
    });
//    if(!_pageData.isLogin){
//	alert('Please Login First');
//	$location.path('admin/login');
//    }
    
    
}
